/**
 * Copyright (c) 2012 Tomi Paananen.
 *
 * Part of Quick Gestures user interface.
 */

import QtQuick 1.1
import com.nokia.symbian 1.1

Item {
    property alias gestureId: idTextField.text
    property alias name: nameTextField.text
    property alias fixedStartingPoint: startingPointCheckBox.checked
    property alias fixedDirection: directionCheckBox.checked

    signal fixedStartingPointSet(bool set);
    signal fixedDirectionSet(bool set);

    width: parent ? parent.width : 360;
    height: idAndNameRow.height + startingPointCheckBoxRow.height * 2
            + mainContainer.spacing * 4;

    // Background and border
    Rectangle {
        anchors.fill: parent
        color: "#cc151515"
    }
    Rectangle {
        y: 1
        width: parent.width
        height: 1
        color: "#404040"
    }

    Column {
        id: mainContainer

        anchors {
            fill: parent
            margins: 10
        }

        spacing: 10

        Row {
            id: idAndNameRow
            width: parent.width
            height: nameTextField.height
            spacing: 10

            Text {
                id: idTextLabel
                height: parent.height
                width: 20
                color: platformStyle.colorNormalLight
                verticalAlignment: Text.AlignVCenter
                font.pixelSize: platformStyle.fontSizeMedium
                text: "ID"
            }
            TextField {
                id: idTextField
                width: 90
                validator: IntValidator { bottom: 0 }
            }
            Text {
                id: nameTextLabel
                height: parent.height
                width: 50
                color: platformStyle.colorNormalLight
                verticalAlignment: Text.AlignVCenter
                font.pixelSize: platformStyle.fontSizeMedium
                text: "Name"
            }
            TextField {
                id: nameTextField
                width: parent.width - idTextLabel.width - idTextField.width
                       - nameTextLabel.width - parent.spacing * 3;
            }
        }
        Row {
            id: startingPointCheckBoxRow
            width: parent.width
            height: startingPointCheckBox.height

            Text {
                width: parent.width - startingPointCheckBox.width
                height: parent.height
                color: platformStyle.colorNormalLight
                verticalAlignment: Text.AlignVCenter
                font.pixelSize: platformStyle.fontSizeMedium
                text: "Fixed starting point"
            }
            CheckBox {
                id: startingPointCheckBox
                onClicked: fixedStartingPointSet(checked);
            }
        }
        Row {
            width: parent.width
            height: directionCheckBox.height

            Text {
                width: parent.width - directionCheckBox.width
                height: parent.height
                color: platformStyle.colorNormalLight
                verticalAlignment: Text.AlignVCenter
                font.pixelSize: platformStyle.fontSizeMedium
                text: "Fixed direction"
            }
            CheckBox {
                id: directionCheckBox
                enabled: !startingPointCheckBox.checked
                onClicked: fixedDirectionSet(checked);
            }
        }
    }
}
